package com.settlement.system.model.entity.common;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.settlement.system.converter.DateFormatConvert;
import com.settlement.system.converter.WpDeliveryTypeConvert;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 唯品会比例设置
 *
 * @author Ximi
 * @since 2020-04-15
 */
@Data
@ExcelIgnoreUnannotated
@HeadStyle(fillBackgroundColor = 9, fillForegroundColor = 9)
@HeadRowHeight(value = 20)
@HeadFontStyle(fontHeightInPoints = 14)
public class TblWpRateConfig extends BaseModel implements Serializable {


    /**
     * 公司编码
     */
    @NotNull(message = "公司编码不能为空")
    @ExcelProperty(value = "公司编码")
    private String companyNo;

    /**
     * 公司名称
     */
    @NotNull(message = "公司名称不能为空")
    @ExcelProperty(value = "公司名称")
    private String companyName;

    /**
     * 发货模式
     */
    @NotNull(message = "发货模式不能为空")
    @ExcelProperty(value = "发货模式",converter = WpDeliveryTypeConvert.class)
    private Integer deliveryType;

    /**
     * 品牌编码
     */
    @ExcelProperty(value = "品牌编码")
    private String brandNo;

    /**
     * 品牌名称
     */
    @ExcelProperty(value = "品牌名称")
    private String brandName;

    /**
     * 零售大类
     */
    @ExcelProperty(value = "零售大类")
    private String retailCategoryName;

    /**
     * 零售大类编码
     */
    private String retailCategoryNo;

    /**
     * 生效日期
     */
    @NotNull(message = "生效日期不能为空")
    @ExcelProperty(value = "生效日期", converter = DateFormatConvert.class)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date effectiveTime;

    /**
     * 折扣率
     */
    @NotNull(message = "折扣率不能为空")
    @ExcelProperty(value = "折扣率")
    private BigDecimal discountRate;

    /**
     * 供应商承担比例
     */
    @NotNull(message = "供应商承担比例不能为空")
    @ExcelProperty(value = "供应商承担比例")
    private BigDecimal supplierAssumeRate;

    /**
     * 进度结算比例
     */
    @NotNull(message = "进度结算比例不能为空")
    @ExcelProperty(value = "进度结算比例")
    private BigDecimal processSettleRate;

    /**
     * 月结结算比例
     */
    @NotNull(message = "月结结算比例不能为空")
    @ExcelProperty(value = "月结结算比例")
    private BigDecimal monthSettleRate;


    @Override
    public String toString() {
        return "TblWpRateConfig{" +
                "companyNo='" + companyNo + '\'' +
                ", companyName='" + companyName + '\'' +
                ", deliveryType=" + deliveryType +
                ", brandNo='" + brandNo + '\'' +
                ", brandName='" + brandName + '\'' +
                ", retailCategoryName='" + retailCategoryName + '\'' +
                ", effectiveTime=" + effectiveTime +
                '}';
    }
}
